import React from 'react';
import { View, Text, Button, StatusBar, SafeAreaView } from 'react-native';
import { createStackNavigator, createAppContainer } from 'react-navigation';
import BottomTabScreen from './Views/BottomTab';
import HomeScreen from './Views/Home';
import DetailsScreen from './Views/Detail';
import MeScreen from './Views/Me';
import LoginScreen from './Views/Login';
import AccordionScreen from './NativeBase/Accordion';
import ActionSheetScreen from './NativeBase/ActionSheet';
import ButtonScreen from './NativeBase/Button';
import CardScreen from './NativeBase/Card';
import CheckBoxScreen from './NativeBase/CheckBox';
import SwipeableListScreen from './NativeBase/SwipeableList';

const routeConfigs = {
  BottomTab     : {
    screen            : BottomTabScreen,
    navigationOptions : {
      header : null
    }
  },
  Home          : {
    //对应一个组件 也就是单页面
    screen            : HomeScreen,
    navigationOptions : {
      header : null
    }
  },
  Details       : {
    screen            : DetailsScreen,
    navigationOptions : {
      header : null
    }
  },
  Me            : {
    screen            : MeScreen,
    navigationOptions : {
      header : null
    }
  },
  Login         : {
    screen            : LoginScreen,
    navigationOptions : {
      header : null
    }
  },
  Accordion     : {
    screen            : AccordionScreen,
    navigationOptions : {
      header : null
    }
  },
  ActionSheet   : {
    screen            : ActionSheetScreen,
    navigationOptions : {
      header : null
    }
  },
  Button        : {
    screen            : ButtonScreen,
    navigationOptions : {
      header : null
    }
  },
  Card          : {
    screen            : CardScreen,
    navigationOptions : {
      header : null
    }
  },
  CheckBox      : {
    screen            : CheckBoxScreen,
    navigationOptions : {
      header : null
    }
  },
  SwipeableList : {
    screen            : SwipeableListScreen,
    navigationOptions : {
      header : null
    }
  }
};
/**
 * 配置路由的参数
 */
const navigatorConfig = {
  initialRouteName        : 'BottomTab',
  initialRouteParams      : { msg: '欢迎来路由栈走走' },
  initialRouteKeys        : 'router',
  disableKeyboardHandling : true,
  mode                    : 'card',
  headerMode              : 'screen'
};
const createNavigator = createStackNavigator(routeConfigs, navigatorConfig);

export default createNavigator;
